<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common/head :: htmlhead">
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">添加个人会员</div>
                <div class="layui-card-body">
                    <form class="layui-form" action="" lay-filter="component-form-element">
                        <!--第一行：姓名性别生日-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg4">
                                <label class="layui-form-label">姓名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="name" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg2">
                                <label class="layui-form-label">性别</label>
                                <div class="layui-input-block">
                                    <select name="gender" lay-verify="required">
                                        <option value=""></option>
                                        <option value="0">男</option>
                                        <option value="1">女</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">出生日期</label>
                                <div class="layui-input-block">
                                    <input type="text" name="borndate" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input" id="date1">
                                </div>
                            </div>
                        </div>
                        <!--第二行：单位、现任职务-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">工作单位</label>
                                <div class="layui-input-block">
                                    <input type="text" name="unit" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">现任职务</label>
                                <div class="layui-input-block">
                                    <input type="text" name="position" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第三行：职称、政治面貌-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">技术职称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="jobtitle" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">政治面貌</label>
                                <div class="layui-input-block">
                                    <select name="politicalstatus" lay-verify="required">
                                        <option value="中共党员">中共党员</option>
                                        <option value="中共预备党员">中共预备党员</option>
                                        <option value="共青团员">共青团员</option>
                                        <option value="无党派或民主党派">无党派或民主党派</option>
                                        <option value="群众">群众</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <!--第四行：所在行业-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">所在行业</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" readonly="readonly"type="text" name="industrytype" id="hangye" placeholder="按照《国民经济行业分类代码索引》填写，精确到中类（如：水泥、石灰和石膏制造业，则填写C301）"
                                           onkeyup="IndustrialClassification()" onclick="IndustrialClassification()" lay-verify="required">
                                    <input type="hidden" id="hangyetag" value="0">
                                </div>
                            </div>
                        </div>
                        <!--第五行：学历、母校、专业-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg2">
                                <label class="layui-form-label">学历</label>
                                <div class="layui-input-block">
                                    <input type="text" name="xueli" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg4">
                                <label class="layui-form-label">毕业院校</label>
                                <div class="layui-input-block">
                                    <input type="text" name="educateschool" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">所学专业</label>
                                <div class="layui-input-block">
                                    <input type="text" name="specialty" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第六行：地址-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6" id="area-picker">
                                <label class="layui-form-label">省市</label>
                                <div class="layui-input-inline layui-col-lg3">
                                    <select name="province" class="province-selector" lay-filter="province-1">
                                        <option value="">请选择省</option>
                                    </select>
                                </div>
                                <div class="layui-input-inline layui-col-lg3" >
                                    <select name="city" class="city-selector" lay-filter="city-1">
                                        <option value="">请选择市</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-col-lg4">
                                <label class="layui-form-label">详细地址</label>
                                <div class="layui-input-block">
                                    <input type="text" name="address" lay-verify="required" placeholder="填写市以后的地址"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第七行：联系电话、邮箱-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">联系电话</label>
                                <div class="layui-input-block">
                                    <input type="text" name="phone" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">电子邮箱</label>
                                <div class="layui-input-block">
                                    <input type="text" name="email" lay-verify="required|email" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第八行：民族籍贯-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">民族</label>
                                <div class="layui-input-block">
                                    <input type="text" name="nation" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">籍贯</label>
                                <div class="layui-input-block">
                                    <input type="text" name="jiguan" lay-verify="required" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第九行：身份证号-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">身份证号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="idcard" lay-verify="required|identity" placeholder=""
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第十行：单位性质-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg4">
                                <label class="layui-form-label">单位性质</label>
                                <div class="layui-input-block">
                                    <select name="unittype" lay-verify="required">
                                        <option value=""></option>
                                        <option value="0">政府机关</option>
                                        <option value="1">事业单位</option>
                                        <option value="2">高校</option>
                                        <option value="3">科研院校</option>
                                        <option value="4">企业</option>
                                        <option value="5">其他</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <!--工作经历-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">工作经历</label>
                                <div class="layui-input-block">
                                    <textarea name="workexperience" placeholder="起止时间、工作单位、职务职称、主要工作内容，重点介绍与博物馆工作有关情况"
                                              class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--工作成果-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">工作成果</label>
                                <div class="layui-input-block">
                                    <textarea name="workresult" placeholder="重点介绍与博物馆工作有关情况" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--所获奖励-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">所获奖励</label>
                                <div class="layui-input-block">
                                    <textarea name="honor" placeholder="重点介绍与博物馆工作有关情况" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--社会兼职-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">社会兼职</label>
                                <div class="layui-input-block">
                                    <textarea name="socialwork" placeholder="重点介绍与博物馆工作有关情况" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--发表论文-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">发表论文</label>
                                <div class="layui-input-block">
                                    <textarea name="publishpaper" placeholder="重点介绍与博物馆工作有关情况" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--承担项目-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">承担项目</label>
                                <div class="layui-input-block">
                                    <textarea name="undertakeproject" placeholder="重点介绍与博物馆工作有关情况" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--提交&重置-->
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="component-form-element">提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.config({
        base: '/static/lib/' //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index', 'form','layarea'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,layarea = layui.layarea
            ,form = layui.form;

        layarea.render({
            elem: '#area-picker',
            change: function (res) {
                //选择结果
                console.log(res);
            }
        });

        form.render(null, 'component-form-element');
        element.render('breadcrumb', 'breadcrumb');

        form.on('submit(component-form-element)', function(data){
            $.ajax({
                url:"/submitper",
                async: false,
                type:"POST",
                dataType: "text",
                data:data.field,
                success: function(data){
                    if(data==="success_per"){
                        layer.open({
                            title: '提交成功'
                            ,content: '个人会员已添加！'
                            ,yes: function(index, layero){
                                parent.layui.admin.events.closeThisTabs();
                                top.layui.index.openTabsPage("/datashow/per", "个人会员信息");
                            }
                        });
                    }
                }
            });
            return false;
        });
    });
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#date1' //指定元素
            ,format:'yyyy/MM/dd'
        });
    });
</script>
<script type="text/javascript" src="/static/js/hangye.js"></script>
</body>
</html>